import {FC} from 'react'
import {states} from './index'
// 声明类型
type Iprops = {
    onChangeState(states:states):void;
    countsArr:Array<number>;
}

const Todooptions:FC<Iprops> = (props) => {
    let {onChangeState,countsArr} = props
    return(
        <fieldset>
            <legend>选项</legend>
            <button onClick={()=>{
                onChangeState(states.all)
            }}>全部:{countsArr[0]}条数据</button>
            <button onClick={()=>{
                onChangeState(states.completed)
            }}>已完成:{countsArr[1]}条数据</button>
            <button onClick={()=>{
                onChangeState(states.unCompleted)
            }}>未完成:{countsArr[2]}条数据</button>
        </fieldset>
    )
}
export default Todooptions